home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0294feb.archive
/
000082_donews!crash!rc…et.edu!AMONROE_Sat, 19 Feb 94 09:59:29 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
4KB
Received: by bkhouse.cts.com (V1.17-beta/Amiga)
id <1vdk@bkhouse.cts.com>; Sat, 19 Feb 94 09:59:29 PST
Received: from crash by donews.cts.com with uucp
(Smail3.1.28.1 #18) id m0pXXeK-0001vPC; Fri, 18 Feb 94 11:01 EST
Received: from byrd.mu.wvnet.edu by crash.cts.com with smtp
(Smail3.1.28.1 #18) id m0pXXRP-0000EJC; Fri, 18 Feb 94 07:48 PST
Received: by byrd.mu.wvnet.edu (5.57/Ultrix3.0-C)
id AA24736; Fri, 18 Feb 94 10:51:33 -0500
Received: From RCBINS/WORKQUEUE by bins00.mu.wvnet.edu
via Charon-4.0A-VROOM with IPX id 100.940218090812.3104;
18 Feb 94 10:47:34 +0500
Message-Id: <MAILQUEUE-101.940218090801.256@rcbins.mu.wvnet.edu>
Date: 18 Feb 94 09:08:01 EST
Priority: normal
X-Mailer: Pegasus Mail v2.3 (R5).
From: "R. Alan Monroe" <AMONROE@rcbins.mu.wvnet.edu>
To: amigae@bkhouse.cts.com
Subject: The Magic 8 Ball, or how to use AreaEllipse...
Here's my wonderful (yeah right :^) ) Magic 8 Ball.
It's really simple. Ask a question, click on the ball. :^)
And it shows the right (I hope) way to draw circles in a
window on the workbench screen. If there's any glaring
logical errors in the program flow please tell me, I mean it
runs and all, but I haven't torture tested it :^)
Oh, you need times 18 in fonts:
Have fun
Alan
MODULE 'intuition/intuition'
MODULE 'graphics/rastport'
MODULE 'graphics/text'
MODULE 'diskfont'
PROC main()
DEF fortune, class
DEF eightwin:PTR TO window
DEF arinf:PTR TO areainfo
DEF artmpras:PTR TO tmpras
DEF arcoords[60]:ARRAY
DEF armem
DEF myrast:PTR TO rastport
DEF myitext:PTR TO intuitext
DEF mytextattr:PTR TO textattr
DEF myfont:PTR TO tf
IF diskfontbase := OpenLibrary('diskfont.library',36)
mytextattr := ['times.font',18,0,1]:textattr
myfont := OpenDiskFont(mytextattr)
CloseLibrary(diskfontbase)
ENDIF
Rnd(-VbeamPos())
IF eightwin := OpenW(0,0,200,210,
(IDCMP_MOUSEBUTTONS OR IDCMP_CLOSEWINDOW),
(WFLG_DRAGBAR OR WFLG_DEPTHGADGET OR
WFLG_CLOSEGADGET OR WFLG_ACTIVATE),
'Magic 8 Ball',0,1,0)
fortune := ['Cannot predict now',
'Better not tell you now',
'Reply hazy try again',
'Concentrate & ask again',
'Ask again later',
'My sources say no',
'Outlook not so good',
'My reply is no',
'Don''t count on it',
'Very doubtful',
'No',
'It is certain',
'Signs point to yes',
'Most likely',
'It is decidedly so',
'Outlook good',
'Yes, definitely',
'As I see it, yes',
'You may rely on it',
'Yes']
arinf := New(SIZEOF areainfo)
artmpras := New(SIZEOF tmpras)
myrast := stdrast
IF armem := AllocRaster(eightwin.width, eightwin.height)
InitTmpRas(artmpras, armem, 5000)
InitArea(arinf, arcoords, 6)
myrast.tmpras := artmpras
myrast.areainfo := arinf
SetAPen(stdrast,1)
SetBPen(stdrast,0)
/*SetOPen(stdrast,4)*/
/*myrast.aolpen := 7 Neither of these seem to work */
AreaMove(stdrast,100,100)
AreaEllipse(stdrast,100,110,92,92)
AreaEnd(stdrast)
IF myfont<>0 THEN SetFont(stdrast,myfont)
Colour(7,1)
myitext := [7,1,RP_JAM2,NIL,103,mytextattr,NIL,0]:intuitext
WHILE (class := WaitIMessage(eightwin)) <> IDCMP_CLOSEWINDOW
IF (class=IDCMP_MOUSEBUTTONS) AND (MsgCode()=SELECTUP)
/*TextF(46,108,'\s',ListItem(fortune,(Rnd(8))) )*/
myitext.itext := ListItem(fortune,(Rnd(20)))
myitext.leftedge := 100-(IntuiTextLength(myitext)/2)
PrintIText(myrast, myitext, 0, 0)
Delay(75)
Box(9,94,190,120,1)
ENDIF
ENDWHILE
FreeRaster(armem, eightwin.width, eightwin.height)
ELSE
TextF(70,100,'No mem for circle drawing!')
Delay(75)
ENDIF
IF myfont THEN CloseFont(myfont)
CloseW(eightwin)
ENDIF
CleanUp(0)
ENDPROC